<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>输出数组的长度</title>
</head>
<body>
    <script>
        let arr = [];
        let length = 5;
        //输入每个同学的分数
        for(let i = 0; i<length; i++){
            arr[i] = prompt('请输入第'+(i+1) +'个同学分数');
        }
        //使用length遍历数组
        for(let i = 0;i<arr.length;i++){
            console.log('第'+(i+1) + '个同学的分数是：'+arr[i]);
        }
        console.log('数组长度为：'+ length);
    </script>
</body>
</html>